<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/




/**
 * 后台管理页
 */
 //后台首页
 Route::get('/admin','houtai\AdminController@admin');
 Route::post('survey','houtai\AdminController@surveypost');
 //评估师评估车辆表单
 Route::get('info','houtai\AdminController@info');
 //评估师评估车辆列表
 Route::get('carDetailList','houtai\AdminController@carDetailList');

 //传过来的ID进行修改
 Route::any('addCarDetail/{car_id}','houtai\AdminController@carDetail');
 //修改的数据进行入库
 Route::get('surveyadd','houtai\AdminController@surveyadd');
 //获取传过来的ID进行入库
 Route::any('addCarSeller/{car_id}','houtai\AdminController@addCarSeller');
 //评估师统计卖车信息
 Route::get('sellerList','houtai\AdminController@sellerList');
 Route::post('seller','houtai\AdminController@sellerpost');
 //后台登入
 Route::get('dengru',"houtai\AdminController@dengru");
 Route::post('dengru',"houtai\AdminController@yanzhengpost");
 //评估师后台检查报告
 Route::any('carInfoList','houtai\AdminController@carInfoList');
 //评估师后台详情页
 Route::get('rewrite/{car_id}','houtai\AdminController@rewrite')->where(['car_id'=>'[0-9]+']);
 //评估师后台详情修改数据提交
 Route::post('tijiao','houtai\AdminController@rewritePost');




Route::any('auth/reg',function(){
	return view('regOk');
});




/*卖家信息录入提交 在路由上面加上一个中间件判断用户是否登陆 如果用户没有登陆跳转登陆页面*/
Route::post('/{city}/sellcar','SellCarController@addPost');

//买家收藏页
Route::get('/{city}/user/collect', 'UserController@collectShow');

//用户点击删除收藏跳转方法
Route::get('user/delete','UserController@deleteCollect');

//卖家获得砍价信息
Route::get('/{city}/user/bargain','UserController@sellerBargain');


//买家提交砍价
Route::any('/postPrice', 'BuycarController@postPrice');
//交易记录
Route::get('/yykc/{car_id}/{sell_id}/{price}', 'BuycarController@yykc');

//砍价情况点击预约看车生成交易订单
Route::get('appoint', 'BuycarController@appoint');
//点击车辆图片收藏车辆
Route::get('/collectId', 'UserController@getCollectId');

/**
 * 注册登录页面路由
 */
//注册页面路由
Route::get('auth/register', 'Auth\AuthController@getRegister');
Route::post('auth/register',
 [
     'middleware' => 'App\Http\Middleware\EmailMiddleware',
     'uses' => 'Auth\AuthController@postRegister'
 ]
 );

//退出登录路由
Route::get('auth/logout', 'Auth\AuthController@getLogout');

//登录路由
Route::get('auth/login', 'Auth\AuthController@getLogin');

// Route::post('auth/login', 'Auth\AuthController@postLogin');
Route::post('auth/login', 'Auth\AuthController@pLogin');

//验证码路由
Route::get('auth/captcha','Auth\AuthController@captcha');

Route::any('auth/reg',function(){
	return view('regOk');
});

//用户点击拒绝用云片发送短信到用户手机上,砍价拒绝
Route::get('/yunpian','UserController@yunpian');

/**
 * 首页路由
 */
//瓜子网首页
Route::get('/{city?}','IndexController@index');
//关键词搜索
Route::post('/{city}/search', 'BuycarController@keyword');

//关键词ajax请求
Route::post('/getBrandPinyin','BuycarController@ajaxBrand');

//侧边栏手机号路由
Route::post('sidebar/mobile', 'IndexController@mobile');

//首页点击车辆跳转详情页
Route::get('/{city}/{car_id}', 'BuycarController@details')->where('car_id','[0-9]+');

//首页点击"我要卖车"跳转方法
Route::get('/{city}/sellcar', 'SellCarController@index');



//买车页面价格路由
Route::get('/{city}/buy/{pn?}', 'BuycarController@indexBuyCar');
//车系 === 价格 路由
Route::get('/{city}/{series}/1/{pn?}/','BuycarController@indexSeries');
//品牌路由
Route::any('/{city}/{brand}/{pn?}','BuycarController@indexBrand')->where('pn','p\d+');

//表单提交
Route::any('su','BuycarController@su');


//交易记录
//Route::get('/yykc','BuycarController@yykc');
